<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

        <title><?php echo $title;?></title>
        <?php $this->load->view('head');?>
        <script type="text/javascript" src="<?php echo CRUD_ROUTE; ?>js/head_scripts.js"></script>
        
    </head>
    <body>
        <div id="layout">
            <?php echo $this->load->view('logo');?>
            <div id="top">
                <?php echo $this->load->view('menu');?>
                <div class="clear"></div>
                <?php echo $this->load->view('botonera');?>
            </div><!-- End of #top -->
            <div id="container" class="container_12">
                <!-- ======= .grid_12 - block begin ======= -->
                <div class="grid_12">
                    <?php if($this->session->flashdata('mensaje_datos_generados') != ''){?>
                        <div class="alert info_msg"><?php echo $this->session->flashdata('mensaje_datos_generados');?></div>
                    <?php }?>
                    <div class="box">
                        <div class="title"><div class="layout"><?php echo $title_table;?></div></div>						
                        <div class="inside">
                            <form id="form_id1" class="formee" method="post" action="<?php echo site_url('crud/operaciones/guardar'); ?>">
                                <div class="in">
                                    <div class="clear"></div>
                                    <?php $cont = 1;?>
                                    <?php $tipo_anterior = null;?>
                                    <?php foreach($query->result_array() as $row){?>
                                        <?php if($tipo_anterior != $row['destipo']){?>
                                            <?php 
                                            $tipo_anterior = $row['destipo'];
                                            if($cont != 1){echo "<hr/>";}
                                            $cont = 1;
                                            ?>
                                            <div class="clear"></div>
                                            <div class="grid-12-12"><label><b><?php echo lang($row['destipo']);?></b></label></div>
                                            <div class="clear"></div>
                                        <?php }?>
                                        <div class="grid-2-12"><label><?php echo lang($row['desc']);?>:</label></div>
                                        <div class="grid-2-12">
                                            <?php 
                                            switch ($row['tipo_campo']) {
                                                case 1:
                                                    echo "i es igual a 1";
                                                    break;
                                                case 2:
                                                    echo "i es igual a 2";
                                                    break;
                                                case 3:
                                                    echo get_radio($row);
                                                    break;
                                                case 4:
                                                    echo "i es igual a 2";
                                                    break;
                                                case 5:
                                                    echo get_numero($row);
                                                    break;
                                                case 6:
                                                    echo "i es igual a 2";
                                                    break;
                                            }
                                            ?>

                                        </div>
                                        <?php if($cont % 3 == 0){
                                            echo '<div class="clear"></div>';
                                        }
                                        $cont++;?>
                                    <?php }?>
                                    <div class="clear"></div>
                                    <div class="grid-10-12"></div>
                                    <div class="grid-2-12"><input class="right button green" type="submit" value="<?php echo lang('guardar'); ?>"/></div>
                                    <div class="clear"></div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <div class="clear"></div>
                <!-- ======= .grid_12 - block end ======= -->
            </div><!-- End of #container -->
        </div><!-- End of #layout -->
        <div class="clear"></div>
        <?php $this->load->view('foot');?>	
    </body>
</html>